//Accepted
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

int main (){
	//freopen("in.txt", "r", stdin);
	int n, i, j, k;
	string s;
	while(getline(cin,s)){
		n=s.size();
		for(j=i=0;j<n;++i){
			while(s[i] && s[i]!=' ')++i;
			if(s[i]==' '){
				for(k=i-1;k>=j;--k)printf("%c", s[k]);
				printf(" ");
			}
			else for(k=i-1;k>=j;--k)printf("%c", s[k]);	
			j=i+1;
		}
		printf("\n");
	}
	return 0;
}
